Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: clock_control: nrf54h: obtain oscillator parameters from BICR #81122

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gmarull
Copy link
Member

@gmarull gmarull commented Nov 8, 2024

BICR should be taken as the source of truth for certain oscillator-related parameters, such as:

  • LFOSC
    • Accuracy
    • Mode
    • Load capacitance
    • Startup time
  • HFXO
    • Mode
    • Load capacitance
    • Startup time

Currently, these were replicated in Devicetree, making it possible to have a non-fully functional system due to mismatches.

@gmarull gmarull force-pushed the bicr-rework branch 2 times, most recently from c4525dc to dded562 Compare November 8, 2024 09:12
@zephyrbot
Copy link
Collaborator

zephyrbot commented Nov 13, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_nordic DNM This PR should not be merged (Do Not Merge) labels Nov 13, 2024
@zephyrbot zephyrbot removed manifest manifest-hal_nordic DNM This PR should not be merged (Do Not Merge) labels Nov 21, 2024
@gmarull gmarull added the DNM This PR should not be merged (Do Not Merge) label Nov 21, 2024
@gmarull
Copy link
Member Author

gmarull commented Nov 21, 2024

DNM: will likely require reflashing BICR as some parameters were never written there.

Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It pains me to see properties related to specific peripheral instances not be part of the peripherals descriptions themselves, but that is actually how this platform works...

Add binding for the Nordic nRF BICR memory.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
BICR (Board Information Configuration Registers) are located within the
application UICR region (ref. MRAM mapping, table 38).

Signed-off-by: Gerard Marull-Paretas <[email protected]>
* @retval 0 On success
* @retval -EINVAL If accuracy is not configured.
*/
int lfosc_get_accuracy(uint16_t *accuracy);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add a prefix to this function, considering it's available in the global scope

The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add a utility function to obtain LFOSC accuracy in PPM from BICR.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants